package com.siam.system.modular.package_user.controller.member;

import com.siam.package_common.entity.BasicData;
import com.siam.package_common.entity.BasicResult;
import com.siam.system.modular.package_user.entity.School;
import com.siam.system.modular.package_user.model.param.SchoolParam;
import com.siam.system.modular.package_user.service.SchoolService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping(value = "/rest/admin/school")
public class SchoolController {

    @Autowired
    private SchoolService schoolService;

    @ApiOperation(value = "学校信息")
    @PostMapping(value = "/list")
    public BasicResult list(@RequestBody @Validated(value = {}) SchoolParam schoolParam) {
        BasicData basicResult = new BasicData();
        List<School> schools = schoolService.getList(schoolParam);
        return BasicResult.success(schools);
    }
}
